/**
 * 
 */
package com.google.code.jkippt.resource;

import java.util.Calendar;


import com.google.code.jkippt.annotation.Experimental;
import com.google.gson.annotations.SerializedName;

/**
 * @author Federico De Faveri defaveri@gmail.com
 *
 */
public class Clip extends Resource {

	protected String url;
	protected String title;
	protected String notes;
	protected Calendar updated;
	protected Calendar created;
	
	@SerializedName("url_domain")
	protected String urlDomain;
	
	protected String via;
	
	//TODO "saves": {"count": 0, "data": []}
	
	protected String list;
	
	//FIXME removed
	@SerializedName("is_read_later")
	protected Boolean readLater;
	
	//TODO "comments": {"count": 0, "data": []}
	
	@SerializedName("favicon_url")
	protected String faviconUrl;
	
	//FIXME is an object
	protected User user;
	
	//FIXME removed
	protected String article;
	
	@SerializedName("is_starred")
	protected Boolean isStarred;
	
	//TODO "likes": {"count": 0, "data": []}

	protected Clip(){}

	/**
	 * @param url
	 */
	public Clip(String url) {
		this.url = url;
	}

	/**
	 * @return the readLater
	 */
	public Boolean getReadLater() {
		return readLater;
	}

	/**
	 * @param readLater the readLater to set
	 */
	public void setReadLater(Boolean readLater) {
		this.readLater = readLater;
	}

	/**
	 * @return the isStarred
	 */
	public Boolean getIsStarred() {
		return isStarred;
	}

	/**
	 * @param isStarred the isStarred to set
	 */
	public void setIsStarred(Boolean isStarred) {
		this.isStarred = isStarred;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @param notes the notes to set
	 */
	public void setNotes(String notes) {
		this.notes = notes;
	}

	/**
	 * @param list the list to set
	 */
	public void setList(String list) {
		this.list = list;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * @return the notes
	 */
	public String getNotes() {
		return notes;
	}

	/**
	 * @return the updated
	 */
	public Calendar getUpdated() {
		return updated;
	}

	/**
	 * @return the created
	 */
	public Calendar getCreated() {
		return created;
	}

	/**
	 * @return the urlDomain
	 */
	public String getUrlDomain() {
		return urlDomain;
	}

	/**
	 * @return the via
	 * @experimental Experimental API: This API is still under development and is subject to change.
	 */
	@Experimental
	public String getVia() {
		return via;
	}

	/**
	 * @return the list
	 */
	public String getList() {
		return list;
	}

	/**
	 * @return the readLater
	 */
	public boolean isReadLater() {
		return readLater;
	}

	/**
	 * @return the faviconUrl
	 * @experimental Experimental API: This API is still under development and is subject to change.
	 */
	@Experimental
	public String getFaviconUrl() {
		return faviconUrl;
	}

	/**
	 * @return the user
	 * @experimental Experimental API: This API is still under development and is subject to change.
	 */
	@Experimental
	public String getUser() {
		return user.username;
	}

	/**
	 * @return the article
	 * @experimental Experimental API: This API is still under development and is subject to change.
	 */
	@Experimental
	public String getArticle() {
		return article;
	}

	/**
	 * @return the isStarred
	 */
	public boolean isStarred() {
		return isStarred;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Clip [id=");
		builder.append(id);
		builder.append(", resourceUri=");
		builder.append(resourceUri);
		builder.append(", appUrl=");
		builder.append(appUrl);
		builder.append(", title=");
		builder.append(title);
		builder.append(", url=");
		builder.append(url);
		builder.append(", notes=");
		builder.append(notes);
		builder.append(", updated=");
		builder.append(updated);
		builder.append(", created=");
		builder.append(created);
		builder.append(", urlDomain=");
		builder.append(urlDomain);
		builder.append(", via=");
		builder.append(via);
		builder.append(", list=");
		builder.append(list);
		builder.append(", readLater=");
		builder.append(readLater);
		builder.append(", faviconUrl=");
		builder.append(faviconUrl);
		builder.append(", user=");
		builder.append(user.username);
		builder.append(", article=");
		builder.append(article);
		builder.append(", isStarred=");
		builder.append(isStarred);
		builder.append("]");
		return builder.toString();
	}
}
